package com.weihui.jxc.view;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.Toolkit;

import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.InternalFrameAdapter;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;

import com.weihui.jxc.common.ValidationManager;
import com.weihui.jxc.view.customer.CustomerEditPanel;
import com.weihui.jxc.view.customer.CustormerAddPanel;
import com.weihui.jxc.view.goods.GoodsAddPanel;
import com.weihui.jxc.view.goods.GoodsEditPanel;
import com.weihui.jxc.view.operater.OperatorAddPanel;
import com.weihui.jxc.view.operater.OperatorEditPanel;
/**
 * 操作员管理界面
 * @author FPF
 *
 */
public class OperatorInternalFrame extends JInternalFrame {

	
	/**
	 * Create the frame.
	 */
	public OperatorInternalFrame() {
		super("操作员信息管理",true,true,true,true);
		getContentPane().setLayout(new BorderLayout(0, 0));
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		setBounds(screenSize.width/8,screenSize.height/12,screenSize.width*2/5,screenSize.height*2/5);
        //创建选项卡
		JTabbedPane tabPane = new JTabbedPane();
		final OperatorAddPanel addPanel = new OperatorAddPanel();//操作员信息添加面板
		final OperatorEditPanel editPanel = new OperatorEditPanel();//操作员信息编辑面板
		//向选项卡添加面板
		tabPane.addTab("添加操作员",null,addPanel,"操作员信息添加");
		//addPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		tabPane.addTab("编辑操作员", null,editPanel,"操作员信息编辑");
		//editPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		//向Frame窗口添加选项卡
		getContentPane().add(tabPane);
		//给选项卡设置改变监听
		tabPane.addChangeListener(new ChangeListener() {
			
			@Override
			public void stateChanged(ChangeEvent e) {
			    //初始化 编辑界面的下拉列表框
				
			}
		});
		//在操作员管理窗口被激活时，初始化操作员添加界面的供应商下拉选择框。
		addInternalFrameListener(new InternalFrameAdapter() {
			@Override
			public void internalFrameActivated(InternalFrameEvent e) {
				
			}
		});
		pack();//通过内部组件自动设置窗口大小
		setVisible(true);//显示窗口

	}
	
}